/* eslint-disable */
import {
	hiprint
} from 'vue-plugin-hiprint'

// 自定义设计元素1
export const aProvider = function(ops) {
	var addElementTypes = function(context) {
		context.removePrintElementTypes("cProviderModule");
		context.addPrintElementTypes(
			"cProviderModule",
			[
				new hiprint.PrintElementTypeGroup("模板", [{
						tid: 'cProviderModule.numbers',
						title: '单号',
						data: '单号',
						type: 'text',
						options: {
							field: 'numbers',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							hideTitle: false
						}
					},
					{
						tid: 'cProviderModule.proData',
						title: '制单日期',
						data: '制单日期',
						type: 'text',
						options: {
							field: 'proData',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							hideTitle: false
						}
					},
					{
						tid: 'cProviderModule.busData',
						title: '业务日期',
						data: '业务日期',
						type: 'text',
						options: {
							field: 'busData',
							// hideTitle: "1",
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'cProviderModule.operation',
						title: '操作类型',
						data: '操作类型',
						type: 'text',
						options: {
							field: 'operation',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'cProviderModule.method',
						title: '完结方式',
						data: '完结方式',
						type: 'text',
						options: {
							field: 'method',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							textContentVerticalAlign: "middle",

						}
					},
					{
						tid: 'cProviderModule.processing',
						title: '加工单位',
						data: '加工单位',
						type: 'text',
						options: {
							field: 'processing',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle",

						}
					},
					{
						tid: 'cProviderModule.unit',
						title: '我方单位',
						data: '我方单位',
						type: 'text',
						options: {
							field: 'unit',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.plate',
						title: '所属板块',
						data: '所属板块',
						type: 'text',
						options: {
							field: 'plate',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.quantity',
						title: '加工数量',
						data: '加工数量',
						type: 'text',
						options: {
							field: 'quantity',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.calculation',
						title: '加工理计',
						data: '加工理计',
						type: 'text',
						options: {
							field: 'calculation',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.processWeight',
						title: '加工实重',
						data: '加工实重',
						type: 'text',
						options: {
							field: 'processWeight',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.quantityAffer',
						title: '加工后数量',
						data: '加工后数量',
						type: 'text',
						options: {
							field: 'quantityAffer',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.adjustment',
						title: '加工后理计',
						data: '加工后理计',
						type: 'text',
						options: {
							field: 'adjustment',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.weightAfter',
						title: '加工后实重',
						data: '加工后实重',
						type: 'text',
						options: {
							field: 'weightAfter',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.lossAdjustment',
						title: '耗损理计',
						data: '耗损理计',
						type: 'text',
						options: {
							field: 'lossAdjustment',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.actualWeight',
						title: '耗损实重',
						data: '耗损实重',
						type: 'text',
						options: {
							field: 'actualWeight',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.coulometer',
						title: '返库理计',
						data: '返库理计',
						type: 'text',
						options: {
							field: 'coulometer',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.warehouse',
						title: '返库实重',
						data: '返库实重',
						type: 'text',
						options: {
							field: 'warehouse',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.processCost',
						title: '加工费',
						data: '加工费',
						type: 'text',
						options: {
							field: 'processCost',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.handled',
						title: '经办人',
						data: '经办人',
						type: 'text',
						options: {
							field: 'handled',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					{
						tid: 'cProviderModule.prepared',
						title: '制单人',
						data: '制单人',
						type: 'text',
						options: {
							field: 'prepared',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
						
						}
					},
					{
						tid: 'cProviderModule.remarks',
						title: '备注',
						data: '备注',
						type: 'text',
						options: {
							field: 'remarks',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "center",
							
						}
					},
					
					{
						tid: 'cProviderModule.details',
						title: '商品明细',
						type: 'table',
						options: {
							field: 'details',
							tableHeaderRepeat: 'first',
							tableFooterRepeat: 'last',
							fields: [{
									text: '类型',
									field: 'CJ'
								},
								{
									text: '品名',
									field: 'PM'
								},
								{
									text: '材质',
									field: 'CZ'
								},
								{
									text: '规格(mm)',
									field: 'GU'
								},
								{
									text: '尺寸(mn)',
									field: 'CH'
								},
								{
									text: '码单',
									field: 'SL'
								},
								{
									text: '厂家',
									field: 'DW'
								},
								{
									text: '单位',
									field: 'JZFS'
								},
								{
									text: '数量',
									field: 'ZL'
								},
								{
									text: '加工理重',
									field: 'DJ'
								},
								{
									text: '加工实重',
									field: 'JE'
								},
								{
									text: '成品号',
									field: 'CPH'
								},
								{
									text: '备注',
									field: 'BZ'
								},
							],
						},
						editable: true,
						columnDisplayEditable: true, //列显示是否能编辑
						columnDisplayIndexEditable: true, //列顺序显示是否能编辑
						columnTitleEditable: true, //列标题是否能编辑
						columnResizable: true, //列宽是否能调整
						columnAlignEditable: true, //列对齐是否调整
						isEnableEditField: true, //编辑字段
						isEnableContextMenu: true, //开启右键菜单 默认true
						isEnableInsertRow: true, //插入行
						isEnableDeleteRow: true, //删除行
						isEnableInsertColumn: true, //插入列
						isEnableDeleteColumn: true, //删除列
						isEnableMergeCell: true, //合并单元格
						columns: [
							[{
									title: '类型',
									align: 'center',
									field: 'CJ',
									width: 150
								},
								{
									title: '品名',
									align: 'center',
									field: 'PM',
									width: 150
								},
								{
									title: '材质',
									align: 'center',
									field: 'CZ',
									width: 150
								},
								{
									title: '规格(mm)',
									align: 'center',
									field: 'GU',
									width: 150
								},
								{
									title: '尺寸(mn)',
									align: 'center',
									field: 'CH',
									width: 150
								},
								{
									title: '码单',
									align: 'center',
									field: 'SL',
									width: 150
								},
								{
									title: '厂家',
									align: 'center',
									field: 'DW',
									width: 150
								},
								{
									title: '单位',
									align: 'center',
									field: 'JZFS',
									width: 150
								},
								{
									title: '数量',
									align: 'center',
									field: 'ZL',
									width: 150
								},
								{
									title: '加工理重',
									align: 'center',
									field: 'DJ',
									width: 150
								},
								{
									title: '加工实重',
									align: 'center',
									field: 'JE',
									width: 150
								},
								{
									title: '成品号',
									align: 'center',
									field: 'CPH',
									width: 150
								},
								{
									title: '备注',
									align: 'center',
									field: 'BZ',
									width: 150
								},

							],
						],
						footerFormatter: function(options, rows, data, currentPageGridRowsData) {
							if (data && data['totalCap']) {
								return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
							}
							return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
						},
					},
					// {tid: 'cProviderModule.logo', title: 'Logo', data: '', type: 'image'},
				]),
				new hiprint.PrintElementTypeGroup("拖拽列表", [{
						tid: 'cProviderModule.text',
						title: '文本',
						data: '李四',
						type: 'text',
						options: {
							field: 'text',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},
					{
						tid: 'cProviderModule.longText',
						title: '长文',
						data: '处处充满创造性',
						type: 'text',
						options: {
							field: 'longText',
							height: 16,
							fontSize: 6.75,
							fontWeight: "700",
							textAlign: "left",
							textContentVerticalAlign: "middle"
						}
					},

				]),

				new hiprint.PrintElementTypeGroup("辅助", [{
						tid: 'cProviderModule.hline',
						title: '横线',
						type: 'hline'
					},
					{
						tid: 'cProviderModule.vline',
						title: '竖线',
						type: 'vline'
					},
					{
						tid: 'cProviderModule.rect',
						title: '矩形',
						type: 'rect'
					},
					{
						tid: 'cProviderModule.oval',
						title: '椭圆',
						type: 'oval'
					}
				])
			]
		);
	};
	return {
		addElementTypes: addElementTypes
	};
};



export default 
[{
	value: 'cProviderModule',
	f: aProvider()
}]

